<!DOCTYPE html>
<html>
<head>
	<title>购物车页面</title>
    <meta charset="utf-8">
    <script type="text/javascript">
        if (/Android (\d+\.\d+)/.test(navigator.userAgent)) {
            var version = parseFloat(RegExp.$1);
            if (version > 2.3) {
                var phoneScale = parseInt(window.screen.width) / 750;
                document.write('<meta name="viewport" content="width=750,minimum-scale=' + phoneScale + ',maximum-scale=' + phoneScale + ',target-densitydpi=device-dpi">');
            } else {
                document.write('<meta name="viewport" content="width=750,target-densitydpi=device-dpi">');
            }
        } else {
            document.write('<meta name="viewport" content="width=750,user-scalable=no,target-densitydpi=device-dpi,minimal-ui">');
        }
    </script>
    <link rel="stylesheet" type="text/css" href="../css/index.css">
    <link rel="stylesheet" type="text/css" href="../css/common.css">
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css">
    <script src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/xdym.js"></script>
    <script type="text/javascript" src="../js/move01.js"></script>

<script>
var iWidth=document.documentElement.getBoundingClientRect().width;iWidth=iWidth>640?640:iWidth;
document.getElementsByTagName("html")[0].style.fontSize=iWidth/10+"px";
</script>
</head>
<body>
<div class="wrap">
<section class="cartList">
		<ul class="contentList" id="contentList">
			<li class="listInfo clearfix" id="listInfo">
				<div class="pic">
					<a href="#" class="imgUrl"><img src="../images/pic.jpg"></a>
				</div>
				<div class="picInfo borderTop">
					<a href="#" class="bookInfo bigFontsize "><p class="cols">爱玩书第一阶段2-4岁折合每。</p></a>
					<div class="yoyotu clearfix">
					<p class="oPrice clearfix"><small class="pink">￥</small><span class="presentPrice pink">1580</span><small class="grey">￥</small><span class="originalPrice">1580</span></p>
					</div>
				    <div class="purchaseNum clearfix">
				        <span class="Reduction01"><a href="javascript:;">-</a></span>
			    	     <input class="sumNum" placeholder="100" type="number"></input>
				        <span class="add"><a href="javascript:;">+</a></span>
			        </div>
				</div>
				<div class="delete"><a href="javasrcipt:;">删除</a></div>
			</li>
			<li class="listInfo clearfix" id="listInfo">
				<div class="pic">
					<a href="#"  class="imgUrl"><img src="../images/pic.jpg"></a>
				</div>
				<div class="picInfo borderTop">
					<a href="http://www.baidu.com" class="bookInfo bigFontsize"><p class="cols">段2-4岁折合每天仅4.3元。</p></a>
					<div class="yoyotu clearfix">
					<p class="oPrice clearfix"><small class="pink">￥</small><span class="presentPrice pink">1580</span><small class="grey">￥</small><span class="originalPrice">1580</span></p>
					</div>
				    <div class="purchaseNum clearfix">
				        <span class="Reduction01"><a href="javascript:;">-</a></span>
			    	    <input class="sumNum" placeholder="100" type="number"></input>
				        <span class="add active"><a href="javascript:;">+</a></span>
			        </div>
				</div>
				<div class="delete"><a href="javasrcipt:;">删除</a></div>
			</li>
			<li class="listInfo clearfix" id="listInfo">
				<div class="pic">
					<a href="#"  class="imgUrl"><img src="../images/pic.jpg"></a>
				</div>
				<div class="picInfo borderTop">
					<a href="http://www.baidu.com" class="bookInfo bigFontsize"><p class="cols">爱玩书第一阶段2-4岁折合每天仅4.3元。爱玩书第一阶段2-4岁折合每天仅4.3元。段2-4岁折合每天仅4.3元。</p></a>
					<div class="yoyotu clearfix">
					<p class="oPrice clearfix"><small class="pink">￥</small><span class="presentPrice pink">1580</span><small class="grey">￥</small><span class="originalPrice">1580</span></p>
					</div>
				    <div class="purchaseNum clearfix">
				        <span class="Reduction01"><a href="javascript:;">-</a></span>
			    	    <input class="sumNum" placeholder="100" type="number"></input>
				        <span class="add active"><a href="javascript:;">+</a></span>
			        </div>
				</div>
				<div class="delete"><a href="javasrcipt:;">删除</a></div>
			</li>
			<li class="listInfo clearfix" id="listInfo">
				<div class="pic">
					<a href="#"  class="imgUrl"><img src="../images/pic.jpg"></a>
				</div>
				<div class="picInfo borderTop">
					<a href="http://www.baidu.com" class="bookInfo bigFontsize"><p class="cols">爱玩书第一阶段2-4岁折合每天仅4.3元。爱玩书第一阶段2-4岁折合每天仅4.3元。段2-4岁折合每天仅4.3元。</p></a>
					<div class="yoyotu clearfix">
					<p class="oPrice clearfix"><small class="pink">￥</small><span class="presentPrice pink">1580</span><small class="grey">￥</small><span class="originalPrice">1580</span></p>
					</div>
				    <div class="purchaseNum clearfix">
				        <span class="Reduction01"><a href="javascript:;">-</a></span>
			    	    <input class="sumNum" placeholder="100" type="number"></input>
				        <span class="add active"><a href="javascript:;">+</a></span>
			        </div>
				</div>
				<div class="delete"><a href="javasrcipt:;">删除</a></div>
			</li>
		</ul>
</section>
	<section class="brandZone">
		<div class="brandTitle">
			<span>为您推荐</span>
			<div class="onePx"></div>
		</div>
	</section>
<section class="recommendations clearfix">
	<div class="recommendationsList">
		<a href="#"><img src="../images/banner_detail.jpg"></a>
		<div class="bookInfo">
		<a href="#">爱玩书第一阶段2-4。</a>
		<p class="k2"><span class="presentPrice pink"><small>￥</small>1580</span><span class="originalPrice"><small>￥</small>1580</span></p>
		<p class="paySum">10人已付款</p>
		</div>
	</div>
	<div class="recommendationsList">
		<a href="#"><img src="../images/list01.jpg"></a>
		<div class="bookInfo">
		<a href="#"><p class="cols">爱玩书第一阶段2-4岁折合每天仅4.3元。阶段2-4岁折合每天仅4.3元。</p></a>
		<p class="k2"><span class="presentPrice pink"><small>￥</small>1580</span><span class="originalPrice"><small>￥</small>1580</span></p>
		<p class="paySum">10人已付款</p>
		</div>
	</div>
</section>
	<footer class="hasfixed">
		<div class="calculate clearfix">
		     <div class="combined">
		     	合计：<span class="sumAll pink" id="sumAll">1580</span>
		     	<span class="save">为您省了<stong id="breaks">￥1580</stong></span>
		     </div>
		     <div class="settlement">
		     	<a href="">结算</a>
		     </div>
		</div>
	</footer>
</div>
</body>
<script type="text/javascript">
$(function(){
	$(".delete").on("touchend",function(event){
		event.preventDefault();
		alert(1)
		var id=this.id;
		if(id){
			confirm =floatNotify.confirm("确定要删除吗？", "",
		        function(t, n) {
		           if(n==true){
		        	   location.href="{pigcms::U('Newgoods/deleteCart',array('token'=>$_GET['token'],'wecha_id'=>$_GET['wecha_id'],'twid'=>$twid))}&id=" + id;
		            }
		    	this.hide();
		      }),
		    confirm.show();
		}
	});
	$('.Reduction01').on('touchend',function(){
		var ids=this.id;
		var id=ids.split('_')['1'];
		if(id){
			plus_minus(id, -1);
		}
	});
	$('.add').on('touchend',function(){
		var ids=this.id;
		var id=ids.split('_')['1'];
		if(id){
			plus_minus(id, 1);
		}
	});
	/* $('.ourl').on('touchend',function(){
		window.location.href=this.href;
	}); */
	$("#savepay").click(function(){
		var is_return = false;
	   $(".sumNum").each(function(){
	     var ids= this.id;
	     var id = ids.split('_')['1'];
	     if(id){
	    	 if(parseInt($('#num_'+id).val()) == 0){
	    		 is_return = true;
	    	 }
	    	 if(parseInt($('#num_'+id).val()) > parseInt($('#payMaxNum'+id).text())){
	    		 $('#num_'+id).focus();
	    		 is_return = true;
	    		 return floatNotify.simple('抱歉，您的购买量不能超过商品最大购买量');
	    	 }
	     }
	   });
	   if(is_return){
		   return false;
	   }
	   location.href="/Wap/Newgoods/orderPay?token={pigcms:$token}&wecha_id={pigcms:$wecha_id}&twid={pigcms:$twid}";
	   // location.href="/index.php?g=Wap&m=Newgoods&a=orderPay&token={pigcms:$token}&wecha_id={pigcms:$wecha_id}&twid={pigcms:$twid}";
	});
});
//加减
function plus_minus(id, number) {
    var num = parseInt($('#num_'+id).val());
    num = num + number;
    if (num < 1) {
        return false;
    }
    $('#num_'+id).attr('value',num);
    update_cart(id, num);     
}
function change_minus(id) {
	var num = parseInt($('#num_'+id).val());
    if (num < 1) {
        num = 0;
    }
    $('#num_'+id).attr('value',num);
    update_cart(id, num);
}


</script>
</html>